//当前的模块：API进行统一管理
import requests from "./request";
import mockRequests from './mockAjax'
export const reqCategoryList = ()=>requests({url:'/product/getBaseCategoryList',method:'get'});
export const reqGetBannerList = ()=>mockRequests.get('/banner')
export const reqGetFloorList = ()=>mockRequests.get('/floor')
export const reqGetSearchInfo = (params)=>requests({url:'/list',method:'post',data:params})
export const reqGetdetailInfo = (skuId)=>requests({url:`/item/${skuId}`,method:'get'})
export const reqAddOrUpdateShopCart = (skuId,skuNum)=>requests({url:`/cart/addToCart/${skuId}/${skuNum}`,method:'post'})
export const reqGetshopcartInfo = ()=>requests({url:'/cart/cartList',method:'get'})
export const reqDeleteshopcartInfo = (skuId)=>requests({url:`/cart/deleteCart/${skuId}`,method:'delete'})
export const reqUpdateIscheckdInfo = (skuId,isChecked)=>requests({url:`/cart/checkCart/${skuId}/${isChecked}`,method:'get'}) 
export const reqGetCodeInfo = (phone)=>requests({url:`/user/passport/sendCode/${phone}`,method:'get'})
export const reqToDoregisterInfo = (data)=>requests({url:'/user/passport/register',method:'post',data:data})
export const reqToDoLoginInfo = (data)=>requests({url:'/user/passport/login',method:'post',data})
export const reqGetuserInfo = ()=>requests({url:'/user/passport/auth/getUserInfo',method:'get'})
export const reqlogoutInfo = ()=>requests({url:'/user/passport/logout',method:'get'})
export const reqAddressInfo = ()=>requests({url:'/user/userAddress/auth/findUserAddressList',method:'get'})
export const reqOrderInfo = ()=>requests({url:'/order/auth/trade',method:'get'})
export const reqSubmitOrderInfo = (tradeNo,data)=>requests({url:`/order/auth/submitOrder?tradeNo=${tradeNo}`,method:'post',data})
export const reqGetOrderPay = (orderId)=>requests({url:`/payment/weixin/createNative/${orderId}`,method:'get'})
export const reqGetpaymentInfo = (orderId)=>requests({url:`/payment/weixin/queryPayStatus/${orderId}`,method:'get'})
export const reqGetorderListInfo =(page,limit)=>requests({url:`/order/auth/${page}/${limit}`,method:'get'})
    //发请求:axios发请求返回结果Promise对象

